# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=ghunt
pkgver=v2.2.0.r24.g42c6035
pkgrel=1
pkgdesc='An offensive OSINT Google framework.'
arch=('any')
groups=('blackarch' 'blackarch-recon')
url='https://github.com/mxrch/GHunt'
license=('AGPL-3.0-only')
depends=('python' # https://github.com/mxrch/GHunt/blob/master/pyproject.toml
         'python-geopy'
         'python-httpx'
         'python-imagehash'
         'python-pillow'
         'python-dateutil'
         'python-rich'
         'python-beautifultable'
         'python-beautifulsoup4'
         'python-alive-progress'
         'python-protobuf'
         'python-autoslot'
         'python-humanize'
         'python-inflection'
         'python-jsonpickle'
         'python-packaging'
         'python-rich-argparse'
         'python-dnspython')
makedepends=('git' 'python-build' 'python-pip')
source=("$pkgname::git+$url.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  ( set -o pipefail
    git describe --long --tags --abbrev=7 2>/dev/null |
      sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
    printf "%s.%s" "$(git rev-list --count HEAD)" \
      "$(git rev-parse --short=7 HEAD)"
  )
}

build() {
  cd $pkgname

  python -m build --wheel --outdir="$startdir/dist"
}

package() {
  cd $pkgname

  pip install \
    --verbose \
    --disable-pip-version-check \
    --no-warn-script-location \
    --ignore-installed \
    --no-compile \
    --no-deps \
    --root="$pkgdir" \
    --prefix=/usr \
    --no-index \
    --find-links="file://$startdir/dist" \
    $pkgname
}

